package com.pz.cloud.framework.workflow.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pz.cloud.framework.business.workflow.entity.WaitDone;
import com.pz.cloud.framework.business.workflow.service.IWaitDoneService;
import com.pz.cloud.framework.business.workflow.service.IWorkflowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
    @RequestMapping("/workflow/waitDone")
@Api(tags = "待办任务表")
public class WaitDoneController {
    @Autowired
    private IWaitDoneService waitDoneService;
    @Autowired
    private IWorkflowService workflowService;
    /**
     * 分页列表查询
     *
     * @param entity
     * @return
     */
    @AutoLog(value = "待办任务-分页列表查询")
    @ApiOperation(value = "待办任务-分页列表查询", notes = "待办任务-分页列表查询")
    @GetMapping(value = "/list")
    public Result<IPage<WaitDone>> list(WaitDone entity) {
        Result<IPage<WaitDone>> result = new Result<>();
        IPage<WaitDone> page = waitDoneService.findPage(entity);
        result.setSuccess(true);
        result.setResult(page);
        return result;
    }
    /**
     * 已办任务列表查询
     *
     * @param entity
     * @return
     */
    @AutoLog(value = "已办任务-分页列表查询")
    @ApiOperation(value = "已办任务-分页列表查询", notes = "已办任务-分页列表查询")
    @GetMapping(value = "/hasDoneList")
    public Result<IPage<WaitDone>> hasDoneList(WaitDone entity) {
        Result<IPage<WaitDone>> result = new Result<>();
        IPage<WaitDone> page = waitDoneService.findHasDonePage(entity);
        result.setSuccess(true);
        result.setResult(page);
        return result;
    }

}
